//请求统一管理
import requests from "@/api/requests";

//用户登录
export const reqLoginByAdmin=(name,password)=>requests({url:`/admin/login?name=${name}&password=${password}`,method:'post'})
//退出登录
export const reqLogoutByAdmin=()=>requests({url:'/admin/logout',method:'post'})










//添加歌手
export const reqAddSinger=(params)=>requests({url:'/singer/add',method:'post',params})
//查询全部歌手
export const reqShowAllSinger=()=>requests({url:'/singer/showAll',method:'get'})
//保存编辑页面
export const reqUpdateSinger=(params)=>requests({url:'/singer/update',method:'post',params})
//删除歌手
export const reqDeleteSinger=(id)=>requests({url:`/singer/delete?id=${id}`,method:'post'})
//更新歌手图片
export const reqUpdateSingerPic=(params)=>requests({url:'/singer/updatePic',method:'post',params})
//根据名字模糊查询歌手
export const reqShowSingerByName=(name)=>requests({url:`/singer/showSingerByName?name=${name}`,method:'post'})
//根据名字查询id
export const reqShowSingerId=(name)=>requests({url:`/singer/selectToId?name=${name}`,method:'post'})
//id查询歌手
export const reqShowSingerById=(id)=>requests({url:`/singer/selectById?id=${id}`,method:'post'})
//根据性别查询歌手
export const reqShowSingerBySex=(sex)=>requests({url:`/singer/showSingerBySex?sex=${sex}`,method:'post'})








//查询歌曲
export const reqShowAllSong=()=>requests({url:'/song/findAll',method:'get'})
//添加歌曲
export const reqAddSong=(params)=>requests({url:'/song/addSong',method:'post',params})
//根据名字模糊查询
export const reqShowByName=(name)=>requests({url:`/song/findByName?name=${name}`,method:'post'})
//删除歌曲
export const reqDeleteSong=(id)=>requests({url:`/song/deleteSong?id=${id}`,method:'post'})
//更新歌曲
export const reqUpdateSong=(params)=>requests({url:'/song/updateSong',method:'post',params})
//根据歌曲id查询歌曲
export const reqShowSongBySongId=(id)=>requests({url:`/song/findById?id=${id}`,method:'post'})
//根据歌名查询id
export const reqShowSongId=(name)=>requests({url:`/song/findToId?name=${name}`,method:'post'})
//根据歌手id查询歌曲
export const reqShowSongBySingerId=(id)=>requests({url:`/song/findBySingerId?id=${id}`,method:'post'})




//获取tencent关键字
export const reqShowTencent=()=>requests(({url:'/tencent',method:'get'}))



//查询全部歌单
export const reqShowAllSongList=()=>requests({url:'/songList/findAll',method:'get'})
//添加歌单
export const reqAddSongList=(params)=>requests({url:'/songList/addSongList',method:'post',params})
//编辑歌单
export const reqUpdateSongList=(params)=>requests({url:'/songList/updateSongList',method:'post',params})
//删除歌单
export const reqDeleteSongList=(id)=>requests({url:`/songList/deleteSongList?id=${id}`,method:'post'})
//模糊查询歌单
export const reqShowSongListFromName=(title)=>requests({url:`/songList/findFromName?title=${title}`,method:'post'})
//根据风格查询歌单
export const reqShowSongListFromStyle=(style)=>requests({url:`/songList/findByStyle?style=${style}`,method:'post'})







//查询歌单评分
export const reqShowRank=(songListId)=>requests({url:`/rank/findRank?songListId=${songListId}`,method:'post'})
//新增评分
export const reqAddRank=(params)=>requests({url:'/rank/addScore',method:'post',params})










//查询该歌单中所有歌曲
export const reqShowAllSongListSong=(songListId)=>requests({url:`/listSong/findBySongListId?songListId=${songListId}`,method:'post'})
//添加歌单中的歌曲
export const reqAddSongListSong=(params)=>requests({url:'/listSong/addListSong',method:'post',params})
//删除歌单中的歌曲
export const reqDeleteSongListSong=(id)=>requests({url:`/listSong/deleteListSong?id=${id}`,method:'post'})





//查询所有用户
export const reqShowAllConsumer=()=>requests({url:'/consumer/findAll',method:'get'})
//添加用户
export const reqAddConsumer=(params)=>requests({url:'/consumer/addConsumer',method:'post',params})
//删除用户
export const reqDeleteConsumer=(id)=>requests({url:`/consumer/deleteConsumer?id=${id}`,method:'post'})
//用户登录
export const reqConsumerLogin=(userName,password)=>requests({url:`/consumer/login?userName=${userName}&password=${password}`,method:'post'})
//用户退出
export const reqConsumerLogout=()=>requests({url:'/consumer/logout',method:'get'})
//查询用户-userId
export const reqShowConsumerById=(id)=>requests({url:`/consumer/findById?id=${id}`,method:'post'})
//查询用户
export const reqShowConsumerFromId=(id)=>requests({url:`/consumer/findById?id=${id}`,method:'post'})
//更新用户
export const reqUpdateConsumerInfo=(params)=>requests({url:'/consumer/updateConsumer',method:'post',params})
//修改密码
export const reqUpdateConsumerPassword=(id,password)=>requests({url:`/consumer/updatePassword?id=${id}&password=${password}`,method:'post'})













//查询歌单id查询评论
export const reqShowCommentBySongListId=(songListId)=>requests({url:`/comment/findBySongListId?songListId=${songListId}`,method:'post'})
//新增评论
export const reqAddComment=(params)=>requests({url:'/comment/addComment',method:'post',params})
//增加点赞数
export const reqAddCommentUp=(params)=>requests({url:'/comment/addUp',method:'post',params})








//增加歌曲收藏
export const reqAddCollect=(params)=>requests({url:'/collect/addCollect',method:'post',params})
//检查用户是否收藏了该歌曲
export const reqCheckInSong=(userId,songId)=>requests({url:`/collect/checkInSong?userId=${userId}&songId=${songId}`,method:'post'})
//查询该歌曲收藏的id
export const reqShowCollectId=(userId,songId)=>requests({url:`/collect/findCollectId?userId=${userId}&songId=${songId}`,method:'post'})
//删除该收藏
export const reqDeleteCollect=(id)=>requests({url:`/collect/deleteCollect?id=${id}`,method:'post'})
//查询该用户的所有收藏
export const reqShowAllCollectByUserId=(userId)=>requests({url:`/collect/findByUserId?userId=${userId}`,method:'post'})
